package com.test.websample.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private boolean result;
    private String errMsg;
    private T data;

    public static Result success() {
        return new Result(true, "", null);
    }

    public static Result success(Object data) {
        return new Result(true, "", data);
    }

    public static Result error(String errMsg) {
        return new Result(false, errMsg, null);
    }
}
